﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// BaoAn Repository. Good example of CRUD operations.
    ///// </summary>
    public class BaoAnRepository : IBaoAnRepository
    {
        // Create static data access objects
        private static readonly IBaoAnDao _baoAnDao = DataAccess.BaoAnDao;
        //private static readonly IProductDao _productDao = DataAccess.ProductDao;
        //private static readonly ICustomerDao _customerDao = DataAccess.CustomerDao;




        public List<BaoAn> GetList()
        {
          return  _baoAnDao.GetBaoAn().ToList();
        }

        public BaoAn Get(string id)
        {
            return _baoAnDao.GetBaoAnByID(id);
        }

        public void Insert(BaoAn t)
        {
            _baoAnDao.InsertBaoAn(t);
        }

        public void Update(BaoAn t)
        {
            _baoAnDao.UpdateBaoAn(t);
        }

        public void Delete(BaoAn t)
        {
            _baoAnDao.DeleteBaoAn(t);
        }

        public List<BaoAn> GetBaoAnBySchoolIdAndSchoolYear(string SchoolYearID, int schoolId)
        {
            return _baoAnDao.GetBaoAnBySchoolIdAndSchoolYear(SchoolYearID, schoolId);
        }


        public BaoAn GetBaoAnBySchoolIdAndSchoolYearByStuId(string SchoolYearID, int schoolId, string stuId)
        {
            return _baoAnDao.GetBaoAnBySchoolIdAndSchoolYearByStuId(SchoolYearID, schoolId, stuId);
        }


        public List<BaoAn> GetBaoAnBySchoolIdAndSchoolYearAndNgayBaoAn(string SchoolYearID, int schoolId, DateTime ngayBaoAn)
        {
            return _baoAnDao.GetBaoAnBySchoolIdAndSchoolYearAndNgayBaoAn(SchoolYearID, schoolId, ngayBaoAn);
        }
    }
}